package com.shanxi.cz.module.biz.dal.mysql.ammetermqtt;

import java.util.*;

import com.shanxi.cz.framework.common.pojo.PageResult;
import com.shanxi.cz.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.shanxi.cz.framework.mybatis.core.mapper.BaseMapperX;
import com.shanxi.cz.module.biz.dal.dataobject.ammetermqtt.AmmeterMqttDO;
import org.apache.ibatis.annotations.Mapper;
import com.shanxi.cz.module.biz.controller.admin.ammetermqtt.vo.*;

/**
 * mq消息存储 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AmmeterMqttMapper extends BaseMapperX<AmmeterMqttDO> {

    default PageResult<AmmeterMqttDO> selectPage(AmmeterMqttPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AmmeterMqttDO>()
                .eqIfPresent(AmmeterMqttDO::getAmmeterId, reqVO.getAmmeterId())
                .eqIfPresent(AmmeterMqttDO::getAmmeterAddress, reqVO.getAmmeterAddress())
                .eqIfPresent(AmmeterMqttDO::getRecordDate, reqVO.getRecordDate())
                .eqIfPresent(AmmeterMqttDO::getPt, reqVO.getPt())
                .eqIfPresent(AmmeterMqttDO::getCt, reqVO.getCt())
                .eqIfPresent(AmmeterMqttDO::getHz, reqVO.getHz())
                .eqIfPresent(AmmeterMqttDO::getIa, reqVO.getIa())
                .eqIfPresent(AmmeterMqttDO::getIb, reqVO.getIb())
                .eqIfPresent(AmmeterMqttDO::getIc, reqVO.getIc())
                .eqIfPresent(AmmeterMqttDO::getPfa, reqVO.getPfa())
                .eqIfPresent(AmmeterMqttDO::getPfb, reqVO.getPfb())
                .eqIfPresent(AmmeterMqttDO::getPfc, reqVO.getPfc())
                .eqIfPresent(AmmeterMqttDO::getPfs, reqVO.getPfs())
                .eqIfPresent(AmmeterMqttDO::getPall, reqVO.getPall())
                .eqIfPresent(AmmeterMqttDO::getPa, reqVO.getPa())
                .eqIfPresent(AmmeterMqttDO::getPb, reqVO.getPb())
                .eqIfPresent(AmmeterMqttDO::getPc, reqVO.getPc())
                .eqIfPresent(AmmeterMqttDO::getQa, reqVO.getQa())
                .eqIfPresent(AmmeterMqttDO::getQb, reqVO.getQb())
                .eqIfPresent(AmmeterMqttDO::getQc, reqVO.getQc())
                .eqIfPresent(AmmeterMqttDO::getQs, reqVO.getQs())
                .eqIfPresent(AmmeterMqttDO::getSa, reqVO.getSa())
                .eqIfPresent(AmmeterMqttDO::getSb, reqVO.getSb())
                .eqIfPresent(AmmeterMqttDO::getSc, reqVO.getSc())
                .eqIfPresent(AmmeterMqttDO::getSs, reqVO.getSs())
                .eqIfPresent(AmmeterMqttDO::getUa, reqVO.getUa())
                .eqIfPresent(AmmeterMqttDO::getUab, reqVO.getUab())
                .eqIfPresent(AmmeterMqttDO::getUb, reqVO.getUb())
                .eqIfPresent(AmmeterMqttDO::getUbc, reqVO.getUbc())
                .eqIfPresent(AmmeterMqttDO::getUc, reqVO.getUc())
                .eqIfPresent(AmmeterMqttDO::getUca, reqVO.getUca())
                .eqIfPresent(AmmeterMqttDO::getEng, reqVO.getEng())
                .eqIfPresent(AmmeterMqttDO::getEngpoq, reqVO.getEngpoq())
                .eqIfPresent(AmmeterMqttDO::getEngnep, reqVO.getEngnep())
                .eqIfPresent(AmmeterMqttDO::getEngneq, reqVO.getEngneq())
                .betweenIfPresent(AmmeterMqttDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AmmeterMqttDO::getId));
    }

    default List<AmmeterMqttDO> selectList(AmmeterMqttPageReqVO pageReqVO){
        return selectList(new LambdaQueryWrapperX<AmmeterMqttDO>()
                .eqIfPresent(AmmeterMqttDO::getAmmeterId, pageReqVO.getAmmeterId())
                .eqIfPresent(AmmeterMqttDO::getRecordDate, pageReqVO.getRecordDate())
                .orderByDesc(AmmeterMqttDO::getCreateTime));
    }
}